<%--
  Created by IntelliJ IDEA.
  User: This
  Date: 2019/7/12
  Time: 21:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>管理系统</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <%@ include file="base/header.jsp" %>
</head>
<body>

<%@ include file="base/top_menu.jsp" %>
<div class="container-fluid">
    <div class="row-fluid">
        <%@ include file="base/left_menu.jsp" %>

        <!--/span-->
        <div class="span10" id="content">
            <div class="row-fluid">
                <!-- block -->
                <div class="block">
                    <div class="navbar navbar-inner block-header">
                        <div class="muted pull-left">客户信息</div>
                    </div>
                    <div class="block-content collapse in">
                        <div class="span12">
                            <form>
                                <div class="layui-form">
                                    <div>
                                        <label style="text-align: center;padding: 10px 0 5px 0;float: left;">查询：</label>
                                        <div style="float: left;">
                                            <input type="text" name="keyword" placeholder="请输入查询条件" autocomplete="off"
                                                   class="layui-input"
                                                   style="width: 180px;height: 35px;padding: 5px 5px 5px 0;margin-top:1px;">
                                        </div>
                                        <div style="float: left; margin-left: 10px;margin-top: 1px;">
                                            <input id="search" type="button" class="layui-btn layui-btn-normal"
                                                   value="查询" data-type="reload" style="height: 35px;"/>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <table class="layui-hide" id="customer_table" lay-filter="customer">
                    </table>
                    <script type="text/html" id="barDemo">
                        <%--<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>--%>
                        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
                        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
                    </script>
                </div>
            </div>
        </div>
    </div>
    <hr>
</div>
</body>
<script src="${rootPath}/resource/js/customer.js"></script>
<script>
    $(function () {
        // 导航设置
        var remove = ['top_index', 'left_index'];
        var add = ['customer', 'customer_list'];
        initMenu(remove, add);
        // 表格参数设置
        layui.use(['laydate', 'laypage', 'layer', 'table', 'carousel', 'upload', 'element', 'slider'], function () {
            var table = layui.table;
            //执行一个 table 实例
            var url = 'http://' + window.location.host + '${rootPath}/customer_pageList';
            //表单数据
            var col = [[ //表头
                {type: 'checkbox', fixed: 'left'}
                , {field: 'id', title: 'ID',hide:true/* ,fixed: 'left', totalRowText: '合计：'*/}
                , {field: 'cusName', title: '客户名称', edit: 'text'}
                , {field: 'cusPhone', title: '联系方式', edit: 'text'/*sort: true, totalRow: true*/}
                , {field: 'cusAddr', title: '地址', edit: 'text'}
                , {fixed: 'right',title:'操作', align: 'center', toolbar: '#barDemo'}
            ]];
            var table_id = 'customer_table';
            var flag = 'customer';
            // {表格属性,表格id,表格标识,高度,获取数据地址,抬头,表格id（不带#）,表头,是否开启合计栏}
            layTable(table, "#customer_table", flag, 380, url, "客户表", table_id, col,false);
        });
    });
</script>
</html>
